\section{Implementation Summary}
\label{sec:implementation}

The locELM package reproduces the algorithmic structure described in the reference paper. The implementation emphasises modular components that isolate domain management, neural representation, continuity enforcement, and solver logic. Key modules are summarised below.

\subsection{Domain Decomposition}
\begin{itemize}
  \item \texttt{Domain}: constructs one-, two-, or three-dimensional tensor-product domains and partitions them into uniform subdomains; provides index mappings and region queries.
  \item \texttt{CollocationPoints}: generates collocation points for each subdomain using uniform grids, Gauss--Lobatto--Legendre nodes, or random samples.
  \item \texttt{SubdomainInterface}: enumerates interior and boundary interfaces to support continuity and boundary conditions.
\end{itemize}

\subsection{Neural Network Architecture}
\begin{itemize}
  \item \texttt{LocalELMNetwork}: implements shallow subnetworks with one to three hidden layers, fixed random weights drawn from $[-R_m, R_m]$, optional input normalisation to $[-1, 1]$, and a trainable linear output layer.
  \item \texttt{MultiSubdomainNetwork}: aggregates the local models, manages shared initialisation, and exposes utilities for setting and retrieving the concatenated trainable parameters.
\end{itemize}

\subsection{Continuity Enforcement}
\begin{itemize}
  \item \texttt{ContinuityConditions}: uses TensorFlow automatic differentiation to assemble $C^k$ continuity constraints along subdomain interfaces, supporting dimension-specific continuity orders.
\end{itemize}

\subsection{Solver Stack}
\begin{itemize}
  \item \texttt{LinearPDESolver}: builds least-squares systems for linear PDEs, applying PDE residual equations, boundary conditions, and continuity constraints before solving with LAPACK routines provided by SciPy.
  \item \texttt{NonlinearPDESolver}: offers the NLSQ-perturb algorithm and Newton-LLSQ scheme corresponding to the paper's nonlinear solution strategies.
  \item Predefined operators: \texttt{helmholtz\_operator\_1d} and \texttt{helmholtz\_operator\_2d} compute the required derivatives for the benchmarking problems.
\end{itemize}

\subsection{Utilities and Examples}
\begin{itemize}
  \item \texttt{helpers.py}: supplies error metrics (maximum and root-mean-square norms), timing utilities, plotting helpers, and model evaluation routines.
  \item Example scripts \texttt{helmholtz\_1d.py} and \texttt{helmholtz\_2d.py} reproduce the experimental setups from the paper and generate diagnostic figures.
\end{itemize}

Across these modules, the codebase mirrors the algorithmic flow of the reference study while exposing extensibility for additional PDEs, alternative collocation strategies, and backend experimentation.
